package com.zhika.zishi.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;

import com.zhika.zishi.R;
import com.zhika.zishi.adapter.FanLikeAdapter;
import com.zhika.zishi.beans.FanLikeBean;
import com.zhika.zishi.customview.TitleView;
import com.zhika.zishi.interfaces.TitleInterface;

import java.util.ArrayList;

/**
 * Created by shi-02 on 2015/4/17.
 * 个人的粉丝和关注的activity
 */
public class FanLikeActivity extends BaseActivity{

    private TitleView titleView;

    private ListView listView;

    private ArrayList<FanLikeBean> fanlikeList = new ArrayList<>();

    private FanLikeAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fan_like_layout);

        addTestData();

        initView();
    }

    private void initView(){
        Intent intent = getIntent();
        String type = intent.getStringExtra("fan_like");
        titleView = (TitleView) findViewById(R.id.fan_like_title_view);
        titleView.setLeftButtonText("返回");
        titleView.setMiddleRowText(type);
        titleView.hideRightButton();
        titleView.setTitleViewInterface(new TitleInterface() {
            @Override
            public void leftTitleListener() {
                finish();
            }

            @Override
            public void middleTitleListener() {

            }

            @Override
            public void rightTitleListener() {

            }
        });

        listView = (ListView) findViewById(R.id.fan_like_list_view);
        adapter = new FanLikeAdapter(FanLikeActivity.this,fanlikeList);
        listView.setAdapter(adapter);
    }

    /**
     * 测试数据
     */
    private void addTestData(){
        for (int i = 0;i<10;i++){
            FanLikeBean bean = new FanLikeBean();
            bean.setHeaderUrl("dd");
            bean.setNicknameStr("用户昵称1111");
            bean.setIntroductionStr("用户简介1111");

            fanlikeList.add(bean);
        }
    }
}
